package com.elrichuang.userserver.enums;

import java.util.Objects;

/**
 * 体检状态枚举类
 * 0未知
 * 1通过
 * 2不通过
 * @author elric
 * @date 2022-03-01
 */
public enum InterviewBodyCheckEnum {

	BODY_CHECK_UNKNOWN("0","未知"),

	/**
	 * 通过
	 */
	BODY_CHECK_PASSED("1", "通过"),

	/**
	 * 不通过
	 */
	BODY_CHECK_NOT_PASS("2", "不通过");

	private final String code;
	private final String info;

	InterviewBodyCheckEnum(String code, String info) {
		this.code = code;
		this.info = info;
	}

	public String getCode() {
		return code;
	}

	public String getInfo() {
		return info;
	}

	public static InterviewBodyCheckEnum fromCode(String code) {
		for (InterviewBodyCheckEnum type : InterviewBodyCheckEnum.values()) {
			if (Objects.equals(type.getCode(), code)) {
				return type;
			}
		}
		return InterviewBodyCheckEnum.BODY_CHECK_UNKNOWN;
	}
}
